<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>创建物价信息</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="description" content="This is my page">
		<!-- Add by liwei 2014.12.16 -->
		<link rel="stylesheet" href="/css/base.css" />
		<link rel="stylesheet" href="/css/form.css" />
		<link rel="stylesheet" media="screen" href="/css/validate.css">
		<script src="/js/jquery-1.11.1.min.js"></script>	
		<script src="/js/jqueryValidation/jquery.validate.min.js"></script>	
		<script src="/js/jqueryValidation/additional-methods.js"></script>	
		<script type="text/javascript">
			 
			function register(){	
				var priceinfo = "";
				$(":input[type=text]").each(function(){
				        priceinfo += this.id + ":" + this.value;
				        priceinfo += ",";
				})
				$('#priceinfo').val(priceinfo)
				$("#createUserForm").submit();
			}
					
			function showImg(fileid) {  
				var reader = new FileReader();  
				var picpreview=document.getElementById("preview");    
				reader.onload = function(e) {  
					var img = $("#photoImg");
					img.attr("src",this.result); 
				}
				reader.readAsDataURL(document.getElementById(fileid).files[0]);  
			}		
		</script>
		
	</head>
	<body >	
		<div id="page">
			<div id="header">
				<h4>后台管理</h4>
			</div>
			
			
			<form enctype="multipart/form-data" method="post" id="createUserForm" action="/app/createPrice">
			
				<input type="hidden" id="priceinfo" name="priceinfo" value=""/>
				
				<p>
					<label>所属地点：</label>
				  	<select name="location" id="location">
					<%if(LocationObjects){%>
						<%  LocationObjects.forEach(function (locationObject){ %>
						<option value='<%= locationObject.id %>'><%= locationObject.get('locationName') %></option>
					<% })} %>  
				  	</select>
				</p>
				  
				  <div id="priceInfo"
				  <%if(PriceTypeObjects){%>
					  <%PriceTypeObjects.forEach(function (priceTypeObject){%>
						 <p>
						 	<label><%=priceTypeObject.get('name')%>：</label>
						 	<input type="text" name="<%=priceTypeObject.id%>" id="<%=priceTypeObject.id%>"/> 元
						 	
						 </p>
					  <%})%>
				  <%}%>
				  </div>
				  
				  <p>
					<input class="change" type="button" onclick="register();" value="提交" />
				  </p>
				
			</form>
			
			<div id="footer">
				<a style="float:right;margin:5px" href="/logout">退出</a>
				<a style="float:right;margin:5px" href="/app/index">主页</a>
			</div>
		</div>
	</body>
</html>
